package it.traveldream.EJB.entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the acquisti database table.
 * 
 */
@Embeddable
public class AcquistiPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="id_pacchetto", insertable=false, updatable=false)
	private int idPacchetto;

	@Column(name="id_utente")
	private int idUtente;

	public AcquistiPK() {
	}
	public int getIdPacchetto() {
		return this.idPacchetto;
	}
	public void setIdPacchetto(int idPacchetto) {
		this.idPacchetto = idPacchetto;
	}
	public int getIdUtente() {
		return this.idUtente;
	}
	public void setIdUtente(int idUtente) {
		this.idUtente = idUtente;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof AcquistiPK)) {
			return false;
		}
		AcquistiPK castOther = (AcquistiPK)other;
		return 
			(this.idPacchetto == castOther.idPacchetto)
			&& (this.idUtente == castOther.idUtente);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idPacchetto;
		hash = hash * prime + this.idUtente;
		
		return hash;
	}
}